package com.xsy.demo.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xsy.demo.annotation.Autowired;
import com.xsy.demo.annotation.Controller;
import com.xsy.demo.annotation.RequestMapping;
import com.xsy.demo.annotation.RequestParam;
import com.xsy.demo.service.EmployeeService;

@Controller
@RequestMapping("/employee")
public class EmployeeController {
	@Autowired("employeeServiceImpl")
	private EmployeeService employeeService;
	
	@RequestMapping("/list")
	public void list(@RequestParam("id") String id,HttpServletRequest req,HttpServletResponse res){
		try {
			PrintWriter pw=res.getWriter();
			pw.write(employeeService.getByID(Integer.valueOf(id)));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
